//
//  CheckTableViewCell.m
//  项目A --半糖
//
//  Created by romana on 16/5/28.
//  Copyright © 2016年 romana. All rights reserved.
//

#import "CheckTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation CheckTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imgView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imgView];
        self.imgViewleft = [[UIImageView alloc] init];
        [self.imgView addSubview:self.imgViewleft];
        self.imgViewright = [[UIImageView alloc] init];
        [self.imgView addSubview:self.imgViewright];
        self.txtLable = [[UILabel alloc] init];
        [self.contentView addSubview:self.txtLable];
        self.txtLable.textColor = [UIColor colorWithRed:254/255.0 green:254/255.0 blue:254/255.0 alpha:1.0];
        self.txtLable.font = [UIFont systemFontOfSize:15];
        self.txtLable.numberOfLines = 1;
        self.txtLable.textAlignment = NSTextAlignmentCenter;
        self.headLabel = [[UILabel alloc] init];
        [self.imgView addSubview:self.headLabel];
        self.headLabel.textAlignment = NSTextAlignmentCenter;
        self.headLabel.textColor = [UIColor colorWithRed:254/255.0 green:254/255.0 blue:254/255.0 alpha:1.0];
        self.headLabel.numberOfLines = 2;
        self.headLabel.font = [UIFont systemFontOfSize:22];
        //        self.headLabel.backgroundColor = [UIColor redColor];
        //        self.txtLable.backgroundColor = [UIColor redColor];
        //        self.imgView.backgroundColor = [UIColor yellowColor];
        //        self.imgViewright.backgroundColor = [UIColor purpleColor];
        //        self.imgViewleft.backgroundColor = [UIColor cyanColor];
    }
    return self;
}


-(void)layoutSubviews{
    [super layoutSubviews];
    self.imgView.frame = CGRectMake(5, 5, self.contentView.frame.size.width - 10, self.contentView.frame.size.height - 10);
    self.txtLable.frame = CGRectMake(20, self.imgView.frame.size.height / 1.8, self.imgView.frame.size.width - 40, self.imgView.frame.size.height / 5);
    self.headLabel.frame = CGRectMake(self.imgView.frame.size.width / 14, self.imgView.frame.size.height / 8.4, self.imgView.frame.size.width * 6/ 7, self.imgView.frame.size.height / 2.5);
    self.imgViewright.frame = CGRectMake(self.imgView.frame.size.width / 2 - self.imgView.frame.size.width / 3, self.imgView.frame.size.height / 2.3, self.imgView.frame.size.width / 3, 15);
    self.imgViewleft.frame = CGRectMake(self.imgView.frame.size.width / 2 , self.imgView.frame.size.height / 2.3, self.imgView.frame.size.width / 3, 15);
   // self.imgViewleft.image = [UIImage imageNamed:@"cut_off_rule_right@2x"];
   // self.imgViewright.image = [UIImage imageNamed:@"cut_off_rule_left@2x"];
}
-(void)setModel:(checkModel *)model{

    _model = model;
    
    NSString *str = _model.cover_image_url;
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:str]];
    self.headLabel.text = _model.title;
    self.txtLable.text = _model.subtitle;


}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
